package com.example.myapplication.fragment;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;


import java.util.ArrayList;
import java.util.List;

public class FragAdapter extends FragmentPagerAdapter {

    List<Fragment> mlist = new ArrayList<>();

    public FragAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        mlist = list;
    }

    @Override
    public Fragment getItem(int position) {
        return  mlist.get(position);
    }

    @Override
    public int getCount() {
        return mlist == null ? 0: mlist.size();
    }
}
